home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 6 / The Arsenal Files 6 (Arsenal Computer).ISO / prg_basi / n_b-v200.zip / NB02 / DMO / FSEEK.TXT < prev    next >
Text File  |  1996-03-11  |  3KB  |  51 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   FSEEK   .TXT ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  19. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  20.  
  21. PowerBASIC keeps internal track of file positions so, when you use SEEK as
  22. function you get back PB's information that may, or may not be DOS's idea of
  23. where the pointers are. This is not important unless you are using any of
  24. the file reading/writing functions that use the file's handle:
  25.  
  26.                fReadBlock?            fWriteBlock?
  27.                fReadBlockPtr?         fWriteBlockPtr?
  28.                fReadB?                fWriteB?
  29.                fReadI%                fWriteI?
  30.                fReadW??               fWriteW?
  31.                fReadL&                fWriteL?
  32.                fReadD???              fWriteD?
  33.  
  34. What happens is that DOS writes/reads the data, updates the file pointers
  35. but because we have by-passed PowerBASIC it doesn't have the changes stored
  36. in it's variables. Mostly all of this is a "tempest in a teacup" as the SEEK
  37. function is a rare call indeed but you need to be aware of the situation.
  38.  
  39.           fSEEK& returns DOS's pointer position at all times!
  40.  
  41. There are 2 other functions that go beyond the SEEK statement that are
  42. available to you if you need them:
  43.  
  44.   fSEEKend& ( Handle% )          same as SEEK #FileNo, LOF(FileNo%)
  45.   fSEEKrel& ( Handle%, Bytes% )  this function will move the pointer
  46.                                  forwards  (Bytes% > 0 ) or
  47.                                  backwards (Bytes% < 0 ) through the
  48.                                  file.
  49.  
  50. Once again, these are rare calls but may come in handy sometime!
  51.